All Questions
19 questions
0votes
1answer
1kviews
Shell script that prompts user for arguments and inserts them as parameters into a python script
I am trying to write a shell script that prompts the user for 3 case-sensitive arguments username password url and then take those parameters and calls a python script i.e.: "python streamcount....
1vote
2answers
2kviews
Running python script many times in a bash file
I want to run a python script many times with various arguments. To do that, I've written the following bash script: requests=(25 50 75 100) factors=(3 6) graphsizes=(25 50 75) for request in "${...
1vote
1answer
7kviews
Run a Bash Script from Python and import the exported environment variables into Python
I have the following Bash script called Test_Vars.sh #!/bin/bash #----------------------------------------------------# # Environment Variables being used in the process # #------------------------...
0votes
1answer
1kviews
Redirecting input from a file to a Python script fails but works with pipe
I have this python script: postpycess.py to draw data from a mesh file airfoil.p3d. This script was designed to work with input not using arguments, so I created an input file commands.txt and ...
1vote
1answer
676views
Specify which version of python duplicity should use
I've got a backup script that utilizes duplicity to upload to Dropbox. It's erroring out because the dropbox-python-sdk version required, 6.9.0, uses the keyword async which is now reserved in python3....
0votes
0answers
3kviews
Get environment variable from python script
I have bash script config.sh in which several variables are exported , and I need those variable in my python script. config.sh export VAR="YES" My approach is to source the config.sh from the ...
0votes
2answers
1kviews
How to run a python cmd inside a bash cmd over ssh
When I run the following in my bash terminal, it works fine. $ bash -c "python -c \"print 'helloworld'\"" ---> helloworld However when I try to do this over ssh, it give me nothing, can someone help ...
22votes
4answers
60kviews
Using Python in a Bash Script [duplicate]
If I try to start python in a bash script, the script will stop running and no commands will execute after "Python" is called. In this simple example, "TESTPRINT" will not be printed. It seems like ...
1vote
2answers
341views
Create several copies of file with one line in each copy changed
I have to automate simulations and to do so I need to create input files for each simulation. The majority of my simulations are almost identical, with one line of text changed from one file to the ...
0votes
1answer
86views
Can I script recreation of files such their inodes/mtimes increase in filename order? Across subdirectories?
Long story short, I have a buggy Makefile that is missing a few prerequisite definitions and consequently accidentally relies on the "order" of files on disk (checked out from an SVN repo) as given by ...
1vote
1answer
132views
Scripting in Bash at an entry level job? [closed]
So, my question is how important is the ability to script in Bash or Python, etc., at an entry level position as a Linux Sys Admin? I'm sort of hedging that I will have time to develop those skill ...
3votes
2answers
2kviews
Script or Program to discover hosts on network
Explanation: I need a script or program to discover devices on my network. I was thinking maybe doing the scan with nmap and I need to display just the name of device, what it is, and also the ip ...
-1votes
2answers
544views
Where can I practice my Python and Bash scripting? [closed]
I wanted to practice my bash scripting skills and python skills and wanted a good book or a site where I can practice and get excellent skills please. Any recommendations please.
5votes
3answers
5kviews
Wait until gnome-terminal ends
I'm trying to implement a script who runs four terminal window in parallel using this function gnome-terminal -e sh -c "python scraper.py". I would like to know if there's a way to wait until each ...
1vote
2answers
2kviews
How can I run this python script on all html files under a directory? [duplicate]
I have a python script $ cat ~/script.py import sys from lxml import etree from lxml.html import parse doc = parse(sys.argv[1]) title = doc.find('//title') title.text = span2.text.strip() print etree....